package com.peng.pojo;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.Objects;

@Table(name = "tb_group_chat", schema = "springboot-tuofu", catalog = "")
public class GroupChat implements Serializable {
    private int id;
    private byte[] content;
    private Timestamp commentTime;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "content")
    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    @Basic
    @Column(name = "comment_time")
    public Timestamp getCommentTime() {
        return commentTime;
    }

    public void setCommentTime(Timestamp commentTime) {
        this.commentTime = commentTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        GroupChat groupChat = (GroupChat) o;
        return id == groupChat.id &&
                Arrays.equals(content, groupChat.content) &&
                Objects.equals(commentTime, groupChat.commentTime);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(id, commentTime);
        result = 31 * result + Arrays.hashCode(content);
        return result;
    }
}
